import http from './request'

export async function FristClassapi(){
    // console.log(data);
    return await http({
        url:'/home/getFirstClassify',
        method:'GET'
    })
}

export async function GetMajorapi(id){
    // console.log(data);
    return await http({
        url:`/home/getMajor/${id}`,
        method:'GET'
    })
}
// home/exam/:classify_id

export async function GetLeftTitleapi(id){
    // console.log(data);
    return await http({
        url:`/home/exam/${id}`,
        method:'GET'
    })
}

// home/getSecondClassify/:classify_id

export async function GetTopTabapi(id){
    // console.log(data);
    console.log('tab++++id',id);
    return await http({
        url:`/home/getSecondClassify/${id}`,
        method:'GET'
    })
}

// home/banner/当前点击的tab的id/4

export async  function GetBannerapi(id){
   console.log('轮播图+++');
    return  await http({
        url:`/home/banner/${id}/4`,
        method:'GET'
    })
}
// home/liveToday/:classify_id

export async  function GetLiveTodayapi(id){
    // console.log('轮播图+++');
    // 今日直播
     return  await http({
         url:`/home/liveToday/${id}`,
         method:'GET'
     })
 }


//  home/getSecondClassify/:classify_id 


// getImgCode
// 图片验证码
export  async function GetImgCodeapi(){
     return await http({
         url:'/getImgCode',
         method:'GET'
     })
 }

//  getsmscode
// 手机验证码
export  async function GetInfoCodeapi(data){
    return await http({
        url:'/getsmscode',
        method:'POST',
        data
    })
}
// 登录
export  async function GetLoginapi(data){
    return await http({
        url:'/login',
        method:'POST',
        data
    })
}

// - getpassword

// 设置密码
export  async function GetSetPassapi(data){
    return await http({
        url:'/getpassword',
        method:'POST',
        data
    })
}
// home/marketingCourse/:classify_id	
// 近期公开课

export  async function GetPubCourseapi(id){
    return await http({
        url:`/home/marketingCourse/${id}`,
        method:'GET'
    })
}

// home/classifyCourse/:**classify_id**
// tab切换数据


export  async function GetTabDataapi(params){
    // console.log('search参数',data);
    return await http({
        url:`/home/classifyCourse/${params.id}`,
        method:'GET',
        params
    })
}

// courseInfo/basis_id=:basis_id/st=0 【
// 详情数据

export  async function GetCourseDetailapi(id){
    return await http({
        url:`/courseInfo/basis_id=${id}/st=0`,
        method:'GET'
    })
}

// - collect


export  async function PostCollectapi(data){
    return await http({
        url:`/collect`,
        method:'POST',
        data
    })
}

// myCourse/studyCourseList

export  async function GetmineCourseapi(){
    return  await http({
        url:`/myCourse/studyCourseList`,
        method:'GET'
    })
}

// collect
export  async function GetCollectapi(){
    return await http({
        url:`/collect`,
        method:'GET',
    })
}


// 喵呜
export function getThemeListApi(){
    return http({
        url:"/square/themeList",
        method:"GET"
    })
}

// 地址
export function getAddressApi(){
    return http({
        url:"/address",
        method:"GET"
    })
}